const sequelize = require('sequelize')
const db = require('@/database')


const order = db.define('aa_order', {
    id: {
        type: sequelize.INTEGER,
        primaryKey: true,//主键
        autoIncrement: true,//自动增长
        allowNull: false,//不允许为空
        field: 'id',
        comment: '主键ID'
    },
    event_id: {
        type: sequelize.INTEGER,
        allowNull: false,
        field: 'event_id',
        comment: '场次id'
    },
    user_id: {
        type: sequelize.INTEGER,
        allowNull: false,
        field: 'user_id',
        comment: '用户id'
    },
    seatId: {
        type: sequelize.INTEGER,
        allowNull: false,
        field: 'seatId',
        comment: '座位id'
    },
    Selseat: {
        type: sequelize.JSON(),
        allowNull: false,
        field: 'seatList',
        comment: '所选座位'
    },
    statu: {
        type: sequelize.INTEGER(),
        allowNull: false,
        field: 'statu',
        comment: '订单状态'
    },
}, { timestamps: true, updatedAt: false });

//抛出模型
module.exports = order